-
-
Notifications
You must be signed in to change notification settings - Fork 316
Issue #2796 View Column type enumeration work around #2798
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…-Defined Table Type Named the same as View
...EJ.EntityFrameworkCore.8.SqlServer.Dacpac/Scaffolding/SqlServerDacpacDatabaseModelFactory.cs
Show resolved
Hide resolved
Interesting approach! Can you look at the build failure? |
Your project file doesn't list 'win-x64' as a "RuntimeIdentifier". You should add 'win-x64' to the "RuntimeIdentifiers" property in your project file and then re-run NuGet restore.
I don't think it was my stuff, as my fix was in a project I didn't touch... but the solution now builds locally; let's see what it does here. |
Looks like you added a project in the tests folder... |
The dacpac builder project, I can remove it now that the dacpac is added? |
Yes, maybe preserve the .sql script as test content? |
Completed |
What will happen if a users .dacpac contains a table type and a view with same name (could happen) ? |
…hould add 'win' to the "RuntimeIdentifiers" property in your project file and then re-run NuGet restore.
It only tries the Table type method if it would otherwise be skipped previously, and the table type name and column names have to both match the view name and column name; that is how it works |
I figure if they are all named the same, it's pretty guaranteed that they should be the same type. I Could add an extra check to ensure all Table Type columns exist in the view? |
That would be great thanks |
…ype to infer view columns types
Thanks, this is a great contribution - I will have a closer look tomorrow |
Using this work-around, the column type of columns can be established by using a User-Defined Table Type Named the same as the View, with columns named the same as the View's columns.
i.e.